//
//  HomePageCellView.m
//  Mtime2.0
//
//  Created by 凉气的Mac on 16/9/4.
//  Copyright © 2016年 凉气的Mac. All rights reserved.
//

#import "HomePageCellView.h"

@implementation HomePageCellView



-(instancetype)initWithFrame:(CGRect)frame{

    if (self = [super initWithFrame:frame]) {
        
        [self addMySubViews];
        
        [self setMySuViewConstraints];
        
    }

    return self;
}


#pragma mark --
#pragma mark --添加子控件
-(void)addMySubViews{

    UILabel *titelLable = [[UILabel alloc]init];

    self.titleLable = titelLable;
    
    titelLable.font = [UIFont systemFontOfSize:14];
    
    [self addSubview:titelLable];
    
    UILabel *textLable = [[UILabel alloc]init];
    
    self.textLable = textLable;
    
    textLable.numberOfLines = 0;
    
    textLable.textColor = [UIColor colorWithWhite:0.800 alpha:1.000];
    
    textLable.font = [UIFont systemFontOfSize:12];
    
    [self addSubview:textLable];
    
    UIImageView *picture = [[UIImageView alloc]init];

    self.picture = picture;
    
    [self addSubview:picture];
    
}

//设置约束
-(void)setMySuViewConstraints{

    [self.titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self).offset(10);
        
        make.width.equalTo(self);
        
        make.top.equalTo(self).offset(5);
        
        
        
    }];
    
    [self.textLable mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self).offset(10);
        
        make.width.equalTo(self).offset(-30);
        
        make.top.equalTo(self.titleLable.mas_bottom).offset(5);
        
    }];
    
    [self.picture mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.textLable.mas_bottom);
        
        make.left.right.bottom.equalTo(self);
        
    }];
    

}

@end


























































